<!-- 注册页 -->
<template>
  <div class="admin-login">
    <div class="login-container">
      <div class="login-right">
        <el-form :model="loginFormData">
          <el-form-item label="">
            <el-input prefix-icon="el-icon-user" style="
              height: 44px; 
              margin-right: 10px" class="login-input" placeholder="用户名">
            </el-input>
          </el-form-item>
          <el-form-item label="">
            <el-input prefix-icon="el-icon-lock" style="
              height: 44px; 
              margin-right: 10px" class="login-input" placeholder="密码">
            </el-input>
          </el-form-item>
          <el-button class="login-btn" type="primary" @click="loginBtn">注册</el-button>
        </el-form>
      </div>
    </div>
  </div>
</template>
<script>
// 引入路由
import { useRouter } from "vue-router";
import { ElMessage } from "element-plus";
export default {
  name: "login",
  setup() {
    const router = useRouter();
    // 注册成功跳转到登录页
    const loginBtn = () => {
      router.push("/");
      // 注册成功提示
      ElMessage({
        type: "success",
        message: '注册成功',
      })
    }
    return { loginBtn };
  },
};
</script>
  
<style lang="scss" scoped>
.admin-login {
  position: relative;
  height: 100vh;
  background-image: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
  padding: 0 1rem;
  overflow: hidden;
}

.login-container {
  height: 100%;
  position: relative;
  display: flex;
  justify-content: space-around;
  align-items: center;

}

.login-left {
  width: 25%;
  min-width: 300px;
  max-width: 500px;
  background-size: 100%;
}

.login-right {
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 30%;
  height: 400px;
  border-radius: 1rem;
  box-shadow: 4px 10px 16px rgb(36 37 38 / 13%);
}

$input-height: 44px;

.login-input {
  font-size: 17px;
  width: 300px;

  :deep(.el-input__inner) {
    height: $input-height;
    line-height: $input-height;
    background: #f5f5f5;
    border: 0;

    &:focus+.el-input__prefix {
      color: black;
    }
  }
}

.login-btn {
  width: 100%;
  height: 45px;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 16px;
}

@media screen and (max-width:$sm-width) {
  .login-left {
    display: none;
  }

  .login-right {
    width: 100%;
  }

}
</style>
  